message(STATUS "CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}")
message(STATUS "CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR}")
message(STATUS "EXECUTABLE_OUTPUT_PATH: ${EXECUTABLE_OUTPUT_PATH}")

message(STATUS "jsoncpp_SOURCE_DIR : ${jsoncpp_SOURCE_DIR}")
message(STATUS "jsoncpp_BINARY_DIR : ${jsoncpp_BINARY_DIR}")
message(STATUS "jsoncpp_IS_TOP_LEVEL : ${jsoncpp_IS_TOP_LEVEL}")

message(STATUS "csv2_SOURCE_DIR : ${csv2_SOURCE_DIR}")
message(STATUS "csv2_BINARY_DIR : ${csv2_BINARY_DIR}")
message(STATUS "csv2_IS_TOP_LEVEL : ${csv2_IS_TOP_LEVEL}")

# file(GLOB XML_FILES "${RESOURCE_DIR}/xml/*.xml")
# # message(STATUS ${XML_FILES})
# # 将 XML 文件复制到构建目录
# foreach(xml_file IN LISTS XML_FILES)
#     configure_file(${xml_file} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COPYONLY)
#     message(STATUS "${xml_file}}")
# endforeach()

add_executable(main
    main.cpp
    # ${XML_FILES}
)

# 注意 target_link 链接的是目标名，而不是输出文件名。!!!
# 比如 jsoncpp 的目标名为 jsoncpp_lib，输出文件名为jsoncpp，则应该链接jsoncpp_lib，而不是jsoncpp
#   add_library(${SHARED_LIB} SHARED ${PUBLIC_HEADERS} ${JSONCPP_SOURCES}) # 目标名
#   set_target_properties(${SHARED_LIB} PROPERTIES
#       OUTPUT_NAME jsoncpp # 输出名
#       VERSION ${PROJECT_VERSION}
#       SOVERSION ${PROJECT_SOVERSION}
#       POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS}
#   )

target_include_directories(main
    PRIVATE
    ${PROJECT_SOURCE_DIR}/include
    ${jsoncpp_SOURCE_DIR}/include
    ${pugixml_SOURCE_DIR}/src
)

target_link_libraries(main
    PRIVATE
    jsoncpp_static # jsoncpp_static 
    csv2
    pugixml-static
    
)

# install(FILES ${XML_FILE} DESTINATION ${TemplateLearn_SOURCE_DIR}/bin)

